<?php

/**
 * Empresa form.
 *
 * @package    espazio
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class EmpresaForm extends BaseEmpresaForm
{
  public function configure()
  {
     # 'lista_sectores' => new sfWidgetFormPropelChoiceMany(array('model'=> 'empresa'))
     parent::configure();
     /*
     unset (
       $this['nombre'], $this['url'], $this['direccion']
     );
      
      */
     // Validar email
     $this->validatorSchema['email'] = new sfValidatorEmail();
/*
      $this->widgetSchema['logo'] = new sfWidgetFormInputFile(array(
            'label' => '',
            #'is_image' => true,
            #'edit_mod' => !$this->isNew()
      ));

  $this->validatorSchema['logo'] = new sfValidatorFile(array(
      'required'   => true,
      'path'       => sfConfig::get('sf_upload_dir').'/empresas',
      'mime_types' => 'web_images',
    ));
 *
 */
     $this->widgetSchema['logo'] = new sfWidgetFormInputFileEditable(array(
        'label' => 'Logo de la empresa',
        'file_src' => '/uploads/empresas/'.$this->getObject()->getLogo(),
        'is_image' => true,
        'edit_mode' => !$this->isNew(),
        'template' => '<div> %input% %file% <br />%delete% %delete_label%</div>',
    ));
  }
}
